package com.classes.constants.logic;

import java.nio.ByteBuffer;

public class Constants_class_info extends ConstantsAbstract {
    private short index;

    public Constants_class_info(byte tag) {
        super(tag);
    }

    @Override
    public void parse(ByteBuffer buffer) {
        index = buffer.getShort();
    }

    @Override
    public String toString() {
        return "tag=" + tag + " index=" + index;
    }


    @Override
    public String getContent() {
        for (int i = 1; i <= contants_pool.size(); i++) {
            if (i == index) {
                return contants_pool.get(i - 1).getContent();
            }
        }
        return null;
    }


}
